package com.yvon.service.demo.jdk.extend;

/**
 * @author : Yvon
 * @since : 2021-10-14
 */
public class Parent {
    String name;
    int age;

    public Parent() {
        System.out.println("父类无参构造函数");
    }
    public Parent(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("父类有参构造函数");
    }

    static  {
        System.out.println("父类静态代码块");
    }

    {
        System.out.println("父类非静态代码块");
    }

    Person person = new Person();

    public void print() {
        System.out.println("父类普通方法");
    }
}
